{include file="common/_meta"/}
<title>图片展示</title>
<link href="/static/admin/lib/lightbox2/2.8.1/css/lightbox.css" rel="stylesheet" type="text/css" >
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统设置 <span class="c-gray en">&gt;</span> 商城头图 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"> <a href="javascript:;" onclick="addpic()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe642;</i> 上传</a> <!-- <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> --> <a href="javascript:;" onclick="set()" class="btn btn-success radius"><i class="Hui-iconfont">&#xe6a7;</i> 确认更换</a></span>  &nbsp;&nbsp;&nbsp;&nbsp;
	<a href="javascript:;" onclick="del()" class="btn btn-warning radius"><i class="Hui-iconfont">&#xe6a7;</i> 删除</a></span></div>
	<div class="portfolio-content">
		<ul class="cl portfolio-area">
		{volist name="piclist" id="vo"}
			<li class="item" data-id="{$vo.id}">
				<div class="portfoliobox">

					<input class="checkbox" name="" type="checkbox" value="" {if condition="$vo.on eq 1"} checked {else/}{/if}>
					<div class="picbox"><img src="{$vo.pic_name}"></a></div>
					<!-- <div class="textbox">客厅 </div> -->
				</div>
			</li>
		{/volist}
		</ul>
	</div>
	<!-- 上传图片 -->
	<div id="uploadPic" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content radius">
				<div class="modal-header">
					<h3 class="modal-title">上传图片</h3>
					<a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
				</div>
				<div class="modal-body">
					<article class="page-container" style="padding-right: 10%;">
						<form action="" method="post" class="form form-horizontal" id="" enctype="multipart/form-data">
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-3">选择图片：</label>
								<div class="formControls col-xs-8 col-sm-9">
									<input  type="file"  name="titlepic" class="input-text" autocomplete="off">
								</div>
							</div>
							<div class="row cl">
								<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
									<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
								</div>
							</div>
						</form>
					</article>
				</div>
			</div>
		</div>
	</div>
</div>

{include file="common/_footer"/}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/admin/lib/lightbox2/2.8.1/js/lightbox.min.js"></script> 
<script type="text/javascript">
$(function(){
	$(".portfolio-area li").Huihover();
});

function addpic(){
	$('#uploadPic').modal('show');
}

function set(){
	var ids = [];
	var list = $(":checkbox:checked").closest('li');
	$.each(list,function(index,value){
		ids.push($(this).attr('data-id'));
	});
	$.post("{:url('mallPic')}?act=set",{ids:ids}).success(function(data){
		layer.msg(data.msg);
	});
}

function del(){
	var ids = [];
	var list = $(":checkbox:checked").closest('li');
	$.each(list,function(index,value){
		ids.push($(this).attr('data-id'));
	});
	$.post("{:url('mallPic')}?act=del",{ids:ids}).success(function(data){
		layer.msg(data.msg);
		if (data.code) {
			setTimeout(function(){
				history.go(0);
			},500);
		}		
	});
}

</script>
</body>
</html>